package day8;

/**
 * @author oldliu
 * @since 1.0
 */
public class Thread2 implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i <20 ; i++) {
            //获得当前线程的名字
            System.out.println(Thread.currentThread().getName()+" print :"+i);
        }
    }

    public static void main(String[] args) {
       for(int i=1;i<=4;i++){
//           Thread t=new Thread(new Thread2(),"线程"+i);
//           t.start();
           new Thread(new Thread2(),"线程"+i).start();
       }
    }
}
